<?
session_start();

require_once('config.php');
require_once('class/cls_product.php');
require_once('class/cls_coordinator.php');
require_once('right.php');


$product		= new cls_product();
$right 			= new right();
$coordinator 	= new cls_coordinator();


$coordinator_id		= $_REQUEST['coordinator_id'];

if (isset($_REQUEST['recid']))
{
		
			if (($_SESSION['username']=="admin") || ($_SESSION['id'] == $coordinator_id))	
		{ 
			 $product->delete_product($_REQUEST['recid']);
		}
			else
		{
			echo "<font color='red'><center><strong>It is not your username and password. So you have not a chance to delete. Please Log out.</strong></center></font>";
		}
}
		
if (isset($_REQUEST['logout']))

{
	session_destroy();
	unset($_SESSION['username']);
	unset($_SESSION['id']);
	header("Location: index.php");
	exit();
}//LogOut




//print_r ($object);

?>
<html>
<head>

<title>Dress Page</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="bg_sty.css" rel="stylesheet" type="text/css">

<link href="um_sty.css" rel="stylesheet" type="text/css"><style type="text/css">
<!--
.style2 {color: #000000}
.style15 {
	font-size: 18px;
	color: #F49D1B;
}
.style17 {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	color: #CF810A;
}
.style22 {
	color: #1C1C79;
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.style23 {
	font-size: 24px;
	color: #0A1C7E;
	font-weight: bold;
	font-family: Tahoma, Arial, Verdana;
}
.style25 {font-family: Geneva, Arial, Helvetica, sans-serif; color: #CF810A; font-weight: bold; }
.style9 {color: #FF9933;
	font-weight: bold;
}
-->
</style></head>



<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#F7F9F0">



<table id="Table_01" width="775" border="0" cellpadding="0" cellspacing="0" align="center">

	<tr>

		<td>

<div align="center">
  <table id="Table_01" width="775" height="32" align="center" border="0" cellpadding="0" cellspacing="0">
    <tr>
     <td width="233" height="32"><img src="images/banner.jpg" width="774" height="100" alt=""></td>
      
    </tr>
  </table>
</div>

<div align="center">

<table id="Table_02" width="775" height="24" align="center" bgcolor="#000000" border="0" cellpadding="0" cellspacing="0">

	<tr>

		<td width="500" valign="middle">

		&nbsp;&nbsp;&nbsp;<<a  href="index.php" class="ummenu" >Home</a>		

		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		
		<a href="customer_service.php" class="ummenu">Customer Services</a>
		
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

		<a href="contact_us.php" class="ummenu">Contact Us</a>
		
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

		<a href="aboutus.php" class="ummenu">About Us</a>
		

		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

		<td width="231" height="24" align="right" valign="middle"><a href="http://66.94.233.46/babelfish/trurl_pagecontent?lp=en_ja&trurl=http%3a%2f%2fwww.umgroups.com">

		</a>&nbsp;&nbsp;

		<a href="http://66.94.233.46/babelfish/trurl_pagecontent?lp=en_zt&trurl=http%3a%2f%2fwww.umgroups.com">		</a>&nbsp;&nbsp;

		<a href="http://66.94.233.46/babelfish/trurl_pagecontent?lp=en_ko&trurl=http%3a%2f%2fwww.umgroups.com">		</a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
	</tr>

</table>

</div>

</td>

	</tr>

	<tr>
	  <td>

			<table width="775" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC" align="center">

				<tr><td colspan="7" height="20"></td>

				</tr>

				<tr>

					<td width="5" ></td>

					<td width="154" rowspan="2" valign="top" class="qcontact" style="padding-left: 4px; padding-top: 40px;"><div align="left"> 

					  <table id="table1" align="center" bgcolor="#FFFFFF" border="0" cellpadding="0" cellspacing="0">

<?
		
		//echo "jjj".$_SESSION['username'];
  		$object = $coordinator->get_coordinator();
		//echo "<pre>";
		//print_r ($object);
		//echo "</pre>";
		if (count($object) > 0)
		{
			foreach ($object as $row) {
?>

				<tr>

					<td width="40" height="28">

					<img src="main-img/<?= $row['coordinator_id'].".jpg" ?>" width="40" height="28"></td>

					<td height="28">

					<div class="introLinks">

						<a href="um_products.php?coordinator_id=<?= $row['coordinator_id']  ?>">

						<img alt="" src="images/trans.gif" border="0" height="8" width="120"><br>
						&nbsp; 

					  <span style="text-transform: uppercase"><?= $row['coordinator_name']?></span></a></div>
                      
                      
					
                    
                

						
					</td>

				</tr>
				<tr><td height="20px"></td></tr>				

				<tr>

					<td colspan="2">

					<img alt="" src="images/trans.gif" border="0" height="2" width="1"></td>

				</tr>			
				
				<?			}//for
		}//if
		

		?>

				
				

			</table>
					 
					  </div>

				  </td>

					<td width="11"></td>

				  <td width="401" align="center" valign="top" style="padding-top:40px;">

				  <table width="100%" cellpadding="0" cellspacing="0">
                   
                    <tr>
                      <td valign="top"><img src="main-img/<?= $coordinator_id .".jpg" ?>" width="400" height="225"></td>
                    </tr>
                  </table>
				  <br></td>
				  <td width="11"></td>

				  <td width="160" align="right" valign="top" style="padding-top:40px;">
				  <? $right->showright() ?>
			      </td>
				  <td width="16"></td>

				</tr>
		  </table>
		 
          <table width="775" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF" style="border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC"> 
		  
			<tr><td colspan="6" height="30"></td></tr>
			<tr>
			  <td height="30" colspan="6" class="Listofproduct">&nbsp;&nbsp;List of Products: </td>
			</tr>
			<tr>
			  <td height="20" colspan="6" class="Listofproduct">&nbsp;</td>
			  </tr>
          </table>
          </td>
          </tr>
<?
		//$coordinator_id = $_POST['coordinator_id'];
	
		//echo "jjj".$_SESSION['username'];
		
  		
		if($coordinator_id == 0){
			$object 		= $product->getnewproduct($coordinator_id);
		}else{
			$object 		= $product->get_product($coordinator_id);
		}
		//echo "<pre>";
		//print_r ($object);
		//echo "</pre>";
		if (count($object) > 0)
		{
			foreach ($object as $row) {
?>
       
        <tr >
         
          <td width="150" align="center" valign="middle" bgcolor="#D2D2D2">
		  <input type="hidden" name="coordinator_id" value="<?= $row['coordinator_id'] ?>">
		  <img src="um-image/<?= $row['product_id'].".jpg" ?>" width="50" height="50">		  </td>
         
          <td bgcolor="#D2D2D2" ><span class="li"> &nbsp; &nbsp;<b><?= $row['coordinator']?></b></span></td>
          <td  bgcolor="#D2D2D2" ><span style="COLOR: #666666" class="li"> &nbsp;&nbsp; <b ><?= $row['type']?></b></span></td>
          
          <td bgcolor="#D2D2D2" align="center"><span class="li">$<?= $row['price']?></span>&nbsp;&nbsp;<? if (isset($_SESSION['username'])) { ?><a href="update.php?recid=<?= $row['product_id'] ?>">Edit</a>&nbsp;&nbsp;  <a href="<? $_SERVER['PHP_SELF'] ?>?recid=<?= $row['product_id'] ?>&coordinator_id=<?= $row['coordinator_id'] ?>" onClick="return confirm('Are you sure you want to delete?')">Delete</a><? } ?>		  </td>
		<td bgcolor="#D2D2D2" align="center" valign="middle" width="130"><a href="sales_info.php?id=<?= $row['product_id'] ?>"><img src="images/AddToBasket.gif"></a></td>
        </tr>
		<tr><td colspan="4"  height="2px" bgcolor="#ffffff"></td></tr>
		
		<?			}//for
		}//if
		

		?>
		
	</table>


	  </td>

	</tr>

	<tr>

		<td>&nbsp;</td>

	</tr>

</table>





</body>



</html>